<?php

require_once(Yii::getPathOfAlias('application.views').'/program/CheckoutWizard.php');

class ProgramController extends Controller
{
	public  $action;
	
	public function actionIndex()
	{
		CheckoutWizard::$step = 'programdetails';
		$this->render('/program/index');
	}
	
	public function actionprogramdetails()
	{
		CheckoutWizard::$step = 'programdetails';
		$this->render('/program/index');
	}
	
	public function actionuploadposter()
	{
				/*$model=new Item();
        if(isset($_POST['image']))
        {
            $model->attributes=$_POST['image'];
            $model->image=CUploadedFile::getInstance($model,'image');
            if($model->save())
            {
                $model->image->saveAs('tmp');
                $this->render('/program/index');
            }
        }*/
       
		CheckoutWizard::$step = 'uploadposter';
		$this->render('/program/index');
	}
	
	public function actionplaylist()
	{
		CheckoutWizard::$step = 'playlist';
		$this->render('/program/index');
	}
	
	public function actionscheduletime()
	{
		CheckoutWizard::$step = 'scheduletime';
		$this->render('/program/index');
	}
	
	public  function action__reset()
	{
		CheckoutWizard::$step = '__reset';
		$this->render('/program/index');
	}
public $breadcrumbs;
    public $defaultAction = 'fancyQueue';

    /* this shows you how to create a reusable action in cases that
     * you need to perform the same steps with files in various controllers
     * by using this, you could attach the action to your controller and tell
     * it to save the files in some folder by changing the savePath property
     * in this sample we will use this action in the single file upload view
     */
    public function actions(){
        return array(
            'uploadedSingle'=>array(
                'class'=>'application.components.UploadAction',
                'savePath'=>Yii::app()->getBasePath().DIRECTORY_SEPARATOR. 'single'.DIRECTORY_SEPARATOR,
            )
        );
    }


    //render view
    public function actionFancyQueue(){
        //$this->render('fancyqueuee');
        $this->render('/program/index');
    }

    //render single file upload view
    public function actionFancySingle(){
       // $this->render('fancysingle');
       $this->render('/program/index');
    }
    
    public function actionCreate()
    {
        $model=new Item;
        if(isset($_POST['Item']))
        {
            $model->attributes=$_POST['Item'];
            $model->image=CUploadedFile::getInstance($model,'image');
            if($model->save())
            {
                $model->image->saveAs('path/to/localFile');
                // redirect to success page
            }
        }
        $this->render('create', array('model'=>$model));
    }
    
}